calculating arr